<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>11-作用域-全局和局部</title>
	</head>
	<body>
		<script type="text/javascript">
			//全局作用域：整个script标签对内部
			var num1 = 10;
			console.log(">>1>>>>"+num1);
			
			//定义一个函数
			function p1(){
				//局部作用域-函数体内部
				var num2 = 30;
				num1 = 100;
			}
			console.log(">>2>>>>"+num1);
			
		</script>
	</body>
</html>
